package com.edz.from0507to0513apk.Thirdview;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

/**
 * author: Created by EDZ on 2018/5/11.
 * function:自定义圆角Dialog
 */

public class RoundDialogView extends Dialog {

    private static int default_width = 160;    //默认宽度
    private static int default_height = 160;   //默认高度

    public RoundDialogView(Context context, View layout, int style) {
        this(context, default_width, default_height, layout, style);
    }

    public RoundDialogView(Context context, int width, int height, View layout, int style) {
        super(context, style);
        setContentView(layout);
        Window window = getWindow();
        WindowManager.LayoutParams params = window.getAttributes();
        params.gravity = Gravity.CENTER;
        window.setAttributes(params);
    }
}
